package xyz.ddlnt.serviceusrclient.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import xyz.ddlnt.commonutil.result.Result;
import xyz.ddlnt.model.dto.PageDTO;
import xyz.ddlnt.model.dto.PostFavRecordDTO;
import xyz.ddlnt.model.dto.UserContentInteractionDTO;
import xyz.ddlnt.model.vo.PostRecordVO;

import java.util.List;

/**
 * @author ZZULI_SE 210910
 * @data 2025/5/25 17:40
 */
//@FeignClient(name = "service-usr", url = "yixuewang-service-usr:9015", path = "/post_fav_record")
//@FeignClient(name = "service-usr", url = "http://localhost:9005", path = "/post_fav_record")
@FeignClient(value = "service-usr", path = "/post_fav_record")
public interface PostFavRecordFeignClient {
    /**
     * 判断用户是否收藏了帖子
     * @param userContentInteractionDTO
     * @return
     */
    @PostMapping("/isFavorite")
    Result<Boolean> isFavorite(@RequestBody UserContentInteractionDTO userContentInteractionDTO);

    /**
     * 添加收藏
     * @param postFavRecordDTO
     * @return
     */
    @PostMapping("/addFav")
    Result<Boolean> addFav(@RequestBody PostFavRecordDTO postFavRecordDTO);

    /**
     * 取消收藏
     * @param userContentInteractionDTO
     * @return
     */
    @PostMapping("/removeFav")
    Result<Boolean> removeFav(@RequestBody UserContentInteractionDTO userContentInteractionDTO);

    /**
     * 获取收藏列表
     * @param pageDTO
     * @return
     */
    @PostMapping("/getFavList")
    Result<List<PostRecordVO>> getFavList(@RequestBody PageDTO pageDTO);
}
